/**
 * Created by wangshaohua on 2018/1/26.
 */
var UUID = {
    toString: function () {
        function S4() {
            return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
        }

        return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
    },

    format: function (list) {
        if (list) {
            for (var i = 0; i < list.length; i++) {
                list[i].uid = UUID.toString();
            }
        }
    }
}